/*
 * Copyright (C) 2004-2006 nickyb@users.sourceforge.net
 * 
 * This file is part of FreeQueryBuilder (http://querybuilder.sourceforge.net)
 * 
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */

package net.sourceforge.querybuilder;

import java.awt.FlowLayout;
import java.awt.event.ActionEvent;

import javax.swing.AbstractAction;
import javax.swing.Box;
import javax.swing.BoxLayout;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JToolBar;

import javax.swing.border.CompoundBorder;
import javax.swing.border.EmptyBorder;
import javax.swing.border.EtchedBorder;

public class MainStatusbar extends BasePanel
{
	private JLabel dbprofile;
	private JLabel dbuser;
	
	MainStatusbar()
	{
		super(8,8);
		
		BasePanel databasebar = new BasePanel();
		databasebar.setComponentCenter(dbprofile = new JLabel("database = <none>"));
		databasebar.setComponentEast(dbuser = new JLabel("user = <none>"));
		
		BasePanel pnlCenter = new BasePanel(8,8);
		pnlCenter.setComponentCenter(databasebar);
		pnlCenter.setComponentEast(new MainMemory());
		
		setComponentCenter(pnlCenter);
	}
	
	void connectionChanged(String url, String uid)
	{
		if(url == null)
		{
			dbprofile.setText("database = <none>");
			dbuser.setText("user = <none>");
		}
		else
		{
			dbprofile.setText("database = " + url);
			dbuser.setText("user = " + uid);
		}
	}	
}